package com.ittao.taoaicodemodel.model.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.core.keygen.KeyGenerators;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * VIP兑换码 实体类
 *
 * @author <a href="https://gitee.com/it-heima-ht">程序员 Tao</a>
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table("vip_redeem_code")
public class VipRedeemCode implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @Id(keyType = KeyType.Generator, value = KeyGenerators.snowFlakeId)
    private Long id;

    /**
     * 兑换码
     */
    @Column("code")
    private String code;

    /**
     * 状态：unused-未使用，used-已使用，expired-已过期
     */
    @Column("status")
    private String status;

    /**
     * 兑换码使用有效期
     */
    @Column("validUntil")
    private LocalDateTime validUntil;

    /**
     * 使用时间
     */
    @Column("usedAt")
    private LocalDateTime usedAt;

    /**
     * 使用用户
     */
    @Column("usedBy")
    private String usedBy;

    /**
     * 使用用户ID
     */
    @Column("usedByUserId")
    private Long usedByUserId;

    /**
     * VIP时长（天）
     */
    @Column("vipDuration")
    private Integer vipDuration;

    /**
     * VIP实际过期时间
     */
    @Column("vipExpireTime")
    private LocalDateTime vipExpireTime;

    /**
     * VIP编号
     */
    @Column("vipNumber")
    private Long vipNumber;

    /**
     * 备注信息
     */
    @Column("remark")
    private String remark;

    /**
     * 创建时间
     */
    @Column("createTime")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @Column("updateTime")
    private LocalDateTime updateTime;

    /**
     * 是否删除
     */
    @Column(value = "isDelete", isLogicDelete = true)
    private Integer isDelete;
}
